CUSTOM Windows API .NET 1.08
Loading...
Searching...
No Matches
Custom.CuCustomWndAPI.CuCustomWndDevice Class Reference

Public Types

enum  CutType : byte
 Paper cut type. More...
 
enum  EjectType : byte
 Eject paper type. More...
 
enum  PaperAlignType : byte
 Paper alignment type. More...
 
enum  CashDrawerType : byte
 Cash Drawer connector pin. More...
 
enum  CommunicationPortType : byte
 Communication port. More...
 
enum  TrPrintMode : byte
 Transaction Print. More...
 
enum  DevCounterType : byte
 Counter types supported by the devices. More...
 

Public Member Functions

void Terminate ()
 Close the communication with the device.
 
short GetInfoPrinterId ()
 Get the Printer ID.
 
String GetInfoFirmwareVersion ()
 Get the Firmware Version.
 
String GetInfoDeviceModel ()
 Get the Device Model.
 
CommunicationPortType GetCapCommPortType ()
 Get the type of communication port used by the device.
 
Boolean GetCapPrintAvailable ()
 Get if this device supports print functions.
 
UInt32 GetCapPrinterResolution ()
 Get the print resolution of this device.
 
UInt32 GetCapPrintWidth ()
 Get the print width of this device.
 
void SetCapPrintWidth (UInt32 uiNewPrintWidth)
 Set the print width of this device.
 
String[] GetCapCodepagesList ()
 Get the list of all the codepages supported by the library / device.
 
void SetVirtualPaperEndLimit (UInt32 uiVirtualPaperEndLimitCm)
 Set the Virtual Paper End limit of this device.
 
bool PrinterIsReady ()
 Check if the device is ready.
 
PrinterStatus GetPrinterFullStatus ()
 Get the status of this device.
 
void PrintText (String strText, bool bAddLF=false)
 Print text on a printer.
 
void PrintText (String strText, PrintFontSettings printFont, bool bAddLF=false)
 Print text on a printer.
 
void PrintImageFromPath (String strImageFilePath, PrintImageSettings printImage)
 Print image file from path.
 
void PrintRawImage (PrintImageSettings.RAWBitDepth bits, byte[] pRawBuffer, int dwWidth, int dwHeight, PrintImageSettings printImage)
 Print RAW image buffer.
 
void PrintBitmapImage (Bitmap bmpImage, PrintImageSettings printImage)
 Print Bitmap image.
 
void PrintBarcode (String strBrcText, PrintBarcodeSettings printBarcode)
 Print barcode file from String.
 
void PrintBarcode (byte[] bBrcBuffer, PrintBarcodeSettings printBarcode)
 Print barcode file from buffer.
 
void SetIgnoreWhiteImages (bool bIgnore)
 Set if ignore, or not, the white Images.
 
void SetGrModeToBlackWhite (PrintImageSettings.ImageGRMode imgGrModeType, byte bThreshold)
 Set the graphic conversion mode to Black/White and, if necessary, the threshold.
 
void SetPageModeToRoll (bool bRollMode)
 Set the page mode print to Roll mode.
 
void SetGraphicsTopMargin (UInt32 uiTopMargin)
 Set the top margin added to the graphics print.
 
UInt32 GetGraphicsTopMargin ()
 Get the top margin added to the graphics print.
 
UInt32 CommGetReadTimeout ()
 Get the read timeout of the communication port of this device.
 
void CommSetReadTimeout (UInt32 uiRTimeout)
 Set the read timeout of the communication port of this device.
 
UInt32 CommGetWriteTimeout ()
 Get the write timeout of the communication port of this device.
 
void CommSetWriteTimeout (UInt32 uiWTimeout)
 Set the write timeout of the communication port of this device.
 
void CommClearReadBuffer ()
 Clean the read buffer of the communication port of this device.
 
void CommClearWriteBuffer ()
 Clean the write buffer of the communication port of this device.
 
byte[] CommRead ()
 Direct read from communication port of this device.
 
int CommWrite (byte[] bDataToWrite)
 Direct write to communication port of this device.
 
void TransactionPrint (TrPrintMode tpMode)
 Manage the Transaction Print of the device.
 
void Feed (UInt32 nFeeds)
 Send line feed commands to the device.
 
void Cut (CuCustomWndDevice.CutType cuttype)
 Send cut command to the device.
 
void Eject (CuCustomWndDevice.EjectType ejtype)
 Send eject command to the device.
 
void EjectWithTimeout (CuCustomWndDevice.EjectType ejtype, UInt32 timeOutms)
 Send eject with a timeout command to the device.
 
void Present (UInt32 presentMM)
 Send presentation command to the device.
 
void Align (CuCustomWndDevice.PaperAlignType aligntype)
 Send align command to the device.
 
void OpenCashDrawer (CuCustomWndDevice.CashDrawerType cashDrawertype, UInt32 timeOn, UInt32 timeOff)
 Send open cash drawer command to the device.
 
void ResetDevice (bool bWaitReset)
 Reset the device.
 
void DeletePrinterInternalQueue ()
 Clear / Delete the internal queue of the device.
 
int GetCounter (DevCounterType devCounter)
 Get a device counter.
 
override string ToString ()
 

Detailed Description

Class to use to communciate with the device

Member Enumeration Documentation

◆ CashDrawerType

Cash Drawer connector pin.

Enumerator
CASH_DRAWER_1 

Indicates that the cash drawer selected is DRW1

CASH_DRAWER_2 

Indicates that the cash drawer selected is DRW2

◆ CommunicationPortType

Communication port.

Enumerator
COMMTYPE_USB 

Usb

COMMTYPE_COM 

Serial / Com

COMMTYPE_NET 

Net / Ethernet / Wifi

COMMTYPE_OTHER 

Unknown

◆ CutType

Paper cut type.

Enumerator
CUT_TOTAL 

Indicates to perform a Total Cut

CUT_PARTIAL 

Indicates to perform a Partial Cut

◆ DevCounterType

Counter types supported by the devices.

Enumerator
HEAD_TEMPERATURE 

If supported by the device, this counter is the temperature, in 0.1°C, of the printer Head (for e.g. a value of 255 is a temperature of 25.5°C)

NUM_POWERON 

If supported by the device, this counter is the number of power on

POWER_VOLTAGE 

If supported by the device, this counter is the power voltage, in 0.1V (for e.g. a value of 241 is a power voltage of 24.1V)

NUM_CUTS 

If supported by the device, this counter is the number of "cuts" performed

NUM_RETRACT 

If supported by the device, this counter is the number of "retract" performed

TOTAL_PAPER_REM 

If supported by the device, this counter is the total paper remaining in the roll (when near paper end is segnaled) in cm

PAPER_PRINTED 

If supported by the device, this counter is the total of paper printed in cm

NUM_COVER_OPEN 

If supported by the device, this counter is the number of "cover open"

◆ EjectType

Eject paper type.

Enumerator
EJ_EJECT 

Indicates to perform a Eject

EJ_RETRACT 

Indicates to perform a Retract

◆ PaperAlignType

Paper alignment type.

Enumerator
PALIGN_PRINT 

Indicates to perform a Paper alignment under the printing line

PALIGN_CUT 

Indicates to perform a Paper alignment under the cutting line

◆ TrPrintMode

Transaction Print.

Enumerator
TP_TRANSACTION_REC 

Indicates the library will buffer the print data until the function is called with the TP_TRANSACTION_STOP or TP_TRANSACTION_PRINT

TP_TRANSACTION_STOP 

Indicates the library stop to store the print data

TP_TRANSACTION_PRINT 

Indicates the library stop to store and prints all the print data stored

TP_TRANSACTION_CLEAN 

Indicates the library cleans all the print data stored

Member Function Documentation

◆ Align()

void Custom.CuCustomWndAPI.CuCustomWndDevice.Align ( CuCustomWndDevice::PaperAlignType  aligntype)
inline

Send align command to the device.

Parameters
aligntypethe CuCustomWndDevice.PaperAlignType type to send to the device.


Exceptions
CuCustomWndAPIWrapException

◆ CommClearReadBuffer()

void Custom.CuCustomWndAPI.CuCustomWndDevice.CommClearReadBuffer ( )
inline

Clean the read buffer of the communication port of this device.


Exceptions
CuCustomWndAPIWrapException

◆ CommClearWriteBuffer()

void Custom.CuCustomWndAPI.CuCustomWndDevice.CommClearWriteBuffer ( )
inline

Clean the write buffer of the communication port of this device.


Exceptions
CuCustomWndAPIWrapException

◆ CommGetReadTimeout()

UInt32 Custom.CuCustomWndAPI.CuCustomWndDevice.CommGetReadTimeout ( )
inline

Get the read timeout of the communication port of this device.

Returns
the number that is the read timeout (msec), for the communication port, of this device.
Exceptions
CuCustomWndAPIWrapException

◆ CommGetWriteTimeout()

UInt32 Custom.CuCustomWndAPI.CuCustomWndDevice.CommGetWriteTimeout ( )
inline

Get the write timeout of the communication port of this device.

Returns
the number that is the write timeout (msec), for the communication port, of this device.
Exceptions
CuCustomWndAPIWrapException

◆ CommRead()

byte[] Custom.CuCustomWndAPI.CuCustomWndDevice.CommRead ( )
inline

Direct read from communication port of this device.

Returns
buffer with the received data.
Exceptions
CuCustomWndAPIWrapException

◆ CommSetReadTimeout()

void Custom.CuCustomWndAPI.CuCustomWndDevice.CommSetReadTimeout ( UInt32  uiRTimeout)
inline

Set the read timeout of the communication port of this device.

Parameters
uiRTimeoutthe number that is the new read timeout (msec), for the communication port, of this device.
Exceptions
CuCustomWndAPIWrapException

◆ CommSetWriteTimeout()

void Custom.CuCustomWndAPI.CuCustomWndDevice.CommSetWriteTimeout ( UInt32  uiWTimeout)
inline

Set the write timeout of the communication port of this device.

Parameters
uiWTimeoutthe number that is the new write timeout (msec), for the communication port, of this device.
Exceptions
CuCustomWndAPIWrapException

◆ CommWrite()

int Custom.CuCustomWndAPI.CuCustomWndDevice.CommWrite ( byte[]  bDataToWrite)
inline

Direct write to communication port of this device.

Parameters
bDataToWritebuffer to send.
Returns
the value of the number of sended bytes.
Exceptions
CuCustomWndAPIWrapException

◆ Cut()

void Custom.CuCustomWndAPI.CuCustomWndDevice.Cut ( CuCustomWndDevice::CutType  cuttype)
inline

Send cut command to the device.

Parameters
cuttypethe CuCustomWndDevice.CutType type to send to the device.


Exceptions
CuCustomWndAPIWrapException

◆ DeletePrinterInternalQueue()

void Custom.CuCustomWndAPI.CuCustomWndDevice.DeletePrinterInternalQueue ( )
inline

Clear / Delete the internal queue of the device.


Exceptions
CuCustomWndAPIWrapException

◆ Eject()

void Custom.CuCustomWndAPI.CuCustomWndDevice.Eject ( CuCustomWndDevice::EjectType  ejtype)
inline

Send eject command to the device.

Parameters
ejtypethe CuCustomWndDevice.EjectType type to send to the device.


Exceptions
CuCustomWndAPIWrapException

◆ EjectWithTimeout()

void Custom.CuCustomWndAPI.CuCustomWndDevice.EjectWithTimeout ( CuCustomWndDevice::EjectType  ejtype,
UInt32  timeOutms 
)
inline

Send eject with a timeout command to the device.

Parameters
ejtypethe CuCustomWndDevice.EjectType type to send to the device.


Parameters
timeOutmsthe time in milliseconds after which the movement is performed.

◆ Feed()

void Custom.CuCustomWndAPI.CuCustomWndDevice.Feed ( UInt32  nFeeds)
inline

Send line feed commands to the device.

Parameters
nFeedsThe number of line feed to send to the device.


Exceptions
CuCustomWndAPIWrapException

◆ GetCapCodepagesList()

String[] Custom.CuCustomWndAPI.CuCustomWndDevice.GetCapCodepagesList ( )
inline

Get the list of all the codepages supported by the library / device.

Returns
string array with the codepages list.
Exceptions
CuCustomWndAPIWrapException

◆ GetCapCommPortType()

CommunicationPortType Custom.CuCustomWndAPI.CuCustomWndDevice.GetCapCommPortType ( )
inline

Get the type of communication port used by the device.

Returns
A CommunicationPortType that contains the communication port type.
Exceptions
CuCustomWndAPIWrapException

◆ GetCapPrintAvailable()

Boolean Custom.CuCustomWndAPI.CuCustomWndDevice.GetCapPrintAvailable ( )
inline

Get if this device supports print functions.

Returns
A boolean value to know if this device supports print functions.
Exceptions
CuCustomWndAPIWrapException

◆ GetCapPrinterResolution()

UInt32 Custom.CuCustomWndAPI.CuCustomWndDevice.GetCapPrinterResolution ( )
inline

Get the print resolution of this device.

Returns
A number that is the print resolution.
Exceptions
CuCustomWndAPIWrapException

◆ GetCapPrintWidth()

UInt32 Custom.CuCustomWndAPI.CuCustomWndDevice.GetCapPrintWidth ( )
inline

Get the print width of this device.

Returns
A number that is the print width (dots) of this device.
Exceptions
CuCustomWndAPIWrapException

◆ GetCounter()

int Custom.CuCustomWndAPI.CuCustomWndDevice.GetCounter ( DevCounterType  devCounter)
inline

Get a device counter.

Parameters
devCounterThe DevCounter that identify the counter to get from the device.
Exceptions
CuCustomWndAPIWrapException

◆ GetGraphicsTopMargin()

UInt32 Custom.CuCustomWndAPI.CuCustomWndDevice.GetGraphicsTopMargin ( )
inline

Get the top margin added to the graphics print.

Returns
The fixed top margin (dots) added to every print in graphics mode (default is 16).


Exceptions
CuCustomWndAPIWrapException

◆ GetInfoDeviceModel()

String Custom.CuCustomWndAPI.CuCustomWndDevice.GetInfoDeviceModel ( )
inline

Get the Device Model.

Returns
A string containing the model of this device.
Exceptions
CuCustomWndAPIWrapException

◆ GetInfoFirmwareVersion()

String Custom.CuCustomWndAPI.CuCustomWndDevice.GetInfoFirmwareVersion ( )
inline

Get the Firmware Version.

Returns
A string containing the Firmware release of this device.
Exceptions
CuCustomWndAPIWrapException

◆ GetInfoPrinterId()

short Custom.CuCustomWndAPI.CuCustomWndDevice.GetInfoPrinterId ( )
inline

Get the Printer ID.

Returns
A WORD that containing the Printer ID.
Exceptions
CuCustomWndAPIWrapException

◆ GetPrinterFullStatus()

PrinterStatus Custom.CuCustomWndAPI.CuCustomWndDevice.GetPrinterFullStatus ( )
inline

Get the status of this device.

Returns
A PrinterStatus that contains the printer status.
Exceptions
CuCustomWndAPIWrapException

◆ OpenCashDrawer()

void Custom.CuCustomWndAPI.CuCustomWndDevice.OpenCashDrawer ( CuCustomWndDevice::CashDrawerType  cashDrawertype,
UInt32  timeOn,
UInt32  timeOff 
)
inline

Send open cash drawer command to the device.

Parameters
cashDrawertypethe CuCustomWndDevice.CashDrawerType type to send to the device.
timeOnthe pulse ON time in milliseconds
timeOffthe pulse OFF time in milliseconds

◆ Present()

void Custom.CuCustomWndAPI.CuCustomWndDevice.Present ( UInt32  presentMM)
inline

Send presentation command to the device.

Parameters
presentMMthe value (mm) of the presentation to send to the device.


Exceptions
CuCustomWndAPIWrapException

◆ PrintBarcode() [1/2]

void Custom.CuCustomWndAPI.CuCustomWndDevice.PrintBarcode ( byte[]  bBrcBuffer,
PrintBarcodeSettings  printBarcode 
)
inline

Print barcode file from buffer.

Parameters
bBrcBufferThe buffer to print into barcode.


Parameters
printBarcodethe PrintBarcodeSettings with all the parameters / Attributes to use to print the barcode.


Exceptions
CuCustomWndAPIWrapException

◆ PrintBarcode() [2/2]

void Custom.CuCustomWndAPI.CuCustomWndDevice.PrintBarcode ( String  strBrcText,
PrintBarcodeSettings  printBarcode 
)
inline

Print barcode file from String.

Parameters
strBrcTextThe text string to print into barcode.


Parameters
printBarcodethe PrintBarcodeSettings with all the parameters / Attributes to use to print the barcode.


Exceptions
CuCustomWndAPIWrapException

◆ PrintBitmapImage()

void Custom.CuCustomWndAPI.CuCustomWndDevice.PrintBitmapImage ( Bitmap  bmpImage,
PrintImageSettings  printImage 
)
inline

Print Bitmap image.

Parameters
bmpImagethe bitmap to print.


Parameters
printImageThe PrintImageSettings with all the parameters / Attributes to use to print the image.


Exceptions
CuCustomWndAPIWrapException

◆ PrinterIsReady()

bool Custom.CuCustomWndAPI.CuCustomWndDevice.PrinterIsReady ( )
inline

Check if the device is ready.

Returns
A boolean value that is true if the communication with the device is ok.
Exceptions
CuCustomWndAPIWrapException

◆ PrintImageFromPath()

void Custom.CuCustomWndAPI.CuCustomWndDevice.PrintImageFromPath ( String  strImageFilePath,
PrintImageSettings  printImage 
)
inline

Print image file from path.

Parameters
strImageFilePathstring with the image file path.


Parameters
printImageThe PrintImageSettings with all the parameters / Attributes to use to print the image.


Note
The file formats supported are BMP, GIF, JPEG, PNG, TIFF, Exif, WMF, and EMF.
Exceptions
CuCustomWndAPIWrapException

◆ PrintRawImage()

void Custom.CuCustomWndAPI.CuCustomWndDevice.PrintRawImage ( PrintImageSettings::RAWBitDepth  bits,
byte[]  pRawBuffer,
int  dwWidth,
int  dwHeight,
PrintImageSettings  printImage 
)
inline

Print RAW image buffer.

Parameters
bitsthe bit deph of the RAW data.


Parameters
pRawBufferRAW buffer to print.


Parameters
dwWidthwidth (pixels/dots) of the of RAW image.


Parameters
dwHeightheight (pixels/dots) of the of RAW image.


Parameters
printImageThe PrintImageSettings with all the parameters / Attributes to use to print the image.


Note
For a correct Monochromatic RAW 1 bit buffer, the size must be always ((width in terms of bytes per row) * Height). About the colors palette, if the bit is 0 it will be a black dot and if if the bit is 1 it will be a white dot.
For a correct Greyscale RAW 8 bit buffer, the size must be always (Width * Height). About the colors palette, the byte 0x00 is the black and the 0xFF is the white.
For a correct RGB RAW 24 bit buffer, the size must be always (Width * Height * 3). About the colors palette, the color 0x000000 is the black and the 0xFFFFFF is the white.
Exceptions
CuCustomWndAPIWrapException

◆ PrintText() [1/2]

void Custom.CuCustomWndAPI.CuCustomWndDevice.PrintText ( String  strText,
bool  bAddLF = false 
)
inline

Print text on a printer.

Parameters
strTextThe text string to print.


Parameters
bAddLFThe boolean that is TRUE if must be send a line feed command after the text.


Exceptions
CuCustomWndAPIWrapException

◆ PrintText() [2/2]

void Custom.CuCustomWndAPI.CuCustomWndDevice.PrintText ( String  strText,
PrintFontSettings  printFont,
bool  bAddLF = false 
)
inline

Print text on a printer.

Parameters
strTextThe text string to print.


Parameters
printFontThe PrintFontSettings with all the parameters / Attributes to use to print the text.


Parameters
bAddLFThe boolean that is TRUE if must be send a line feed command after the text.


Exceptions
CuCustomWndAPIWrapException

◆ ResetDevice()

void Custom.CuCustomWndAPI.CuCustomWndDevice.ResetDevice ( bool  bWaitReset)
inline

Reset the device.

Parameters
bWaitResetThe boolean that is TRUE if must be wait the reset and the re-open before exit. If bWaitReset is FALSE, must be close and re-open the device communcation before continue.
Exceptions
CuCustomWndAPIWrapException

◆ SetCapPrintWidth()

void Custom.CuCustomWndAPI.CuCustomWndDevice.SetCapPrintWidth ( UInt32  uiNewPrintWidth)
inline

Set the print width of this device.

Parameters
uiNewPrintWidthA number that is the new print width (dots) of this device.


Exceptions
CuCustomWndAPIWrapException

◆ SetGraphicsTopMargin()

void Custom.CuCustomWndAPI.CuCustomWndDevice.SetGraphicsTopMargin ( UInt32  uiTopMargin)
inline

Set the top margin added to the graphics print.

Parameters
uiTopMarginThe fixed top margin (dots) added to every print in graphics mode (default is 16).


Exceptions
CuCustomWndAPIWrapException

◆ SetGrModeToBlackWhite()

void Custom.CuCustomWndAPI.CuCustomWndDevice.SetGrModeToBlackWhite ( PrintImageSettings::ImageGRMode  imgGrModeType,
byte  bThreshold 
)
inline

Set the graphic conversion mode to Black/White and, if necessary, the threshold.

Parameters
imgGrModeTypethe PrintImageSettings.ImageGRMode conversion to black / white mode.


Parameters
bThresholdthe threshold value to use (only for PrintImageSettings.ImageGRMode.IMAGE_GRMODE_THRESHOLD mode).


Exceptions
CuCustomWndAPIWrapException

◆ SetIgnoreWhiteImages()

void Custom.CuCustomWndAPI.CuCustomWndDevice.SetIgnoreWhiteImages ( bool  bIgnore)
inline

Set if ignore, or not, the white Images.

Parameters
bIgnoreThe boolean that is TRUE when a totally white Image must be ignored and not print (default is FALSE).


Exceptions
CuCustomWndAPIWrapException

◆ SetPageModeToRoll()

void Custom.CuCustomWndAPI.CuCustomWndDevice.SetPageModeToRoll ( bool  bRollMode)
inline

Set the page mode print to Roll mode.

Parameters
bRollModeThe boolean that is TRUE when the printer prints until the last not white line (default is FALSE).


Exceptions
CuCustomWndAPIWrapException

◆ SetVirtualPaperEndLimit()

void Custom.CuCustomWndAPI.CuCustomWndDevice.SetVirtualPaperEndLimit ( UInt32  uiVirtualPaperEndLimitCm)
inline

Set the Virtual Paper End limit of this device.

Parameters
uiVirtualPaperEndLimitCmA number that will be the virtual paper end limit, expressed in cm, of this device (for e.g. "1500" is to set 15m).


Exceptions
CuCustomWndAPIWrapException

◆ Terminate()

void Custom.CuCustomWndAPI.CuCustomWndDevice.Terminate ( )
inline

Close the communication with the device.


Exceptions
CuCustomWndAPIWrapException

◆ ToString()

override string Custom.CuCustomWndAPI.CuCustomWndDevice.ToString ( )
inline

Convert the deviceID to a String

◆ TransactionPrint()

void Custom.CuCustomWndAPI.CuCustomWndDevice.TransactionPrint ( TrPrintMode  tpMode)
inline

Manage the Transaction Print of the device.

Parameters
tpModeTransaction control.


Exceptions
CuCustomWndAPIWrapException